﻿// -----------------------------------------------------------------------
// <copyright file="EventArgsUnit.cs" company="DarkBone">
// DarkBone
// </copyright>
// -----------------------------------------------------------------------

namespace DarkBone.Engine.EventArgs
{
   using System;

   using DarkBone.Engine.Collections;

   /// <summary>
   /// Event args of unit
   /// </summary>
   public sealed class EventArgsUnit : EventArgs
   {
      /// <summary>
      /// Initializes a new instance of the <see cref="EventArgsUnit"/> class.
      /// </summary>
      /// <param name="unit">The unit.</param>
      /// <param name="players">The players.</param>
      public EventArgsUnit(Unit unit, Players players)
      {
         this.Unit = unit;
         this.Owner = players[unit.UnitStruct.Owner];
      }

      /// <summary>
      /// Gets or sets Unit.
      /// </summary>
      public Unit Unit { get; set; }
      
      /// <summary>
      /// Gets or sets Owner.
      /// </summary>
      public Player Owner { get; set; }
   }
}
